// 销售渠道管理
import { base } from '@/config'
import http from '@/utils/request'

const channelApi = {
  // 新增渠道
  addChannelStore: params => {
    return http.postJson(`${base.coupon}/channelStore/add`, params)
  },
  // 编辑渠道
  editChannelStore: params => {
    return http.postJson(`${base.coupon}/channelStore/edit`, params)
  },
  // 编辑是否显示
  updatedStatus: params => {
    return http.postJson(`${base.coupon}/channelStore/edit/isShow`, params)
  },
  // 获取渠道列表
  getChannelStoreList: params => {
    return http.get(`${base.coupon}/channelStore/list`, { params })
  },
  // 删除渠道
  deleteChannelStore: id => {
    return http.post(`${base.coupon}/channelStore/remove/${id}`)
  },
  // 获取渠道下拉选择
  getChannelSelect: () => {
    return http.get(`${base.coupon}/channelStore/selectList`)
  },
  // 获取渠道详情
  getChannelStoreDetail: id => {
    return http.get(`${base.coupon}/channelStore/${id}`)
  }
}

export default channelApi
